import axios from "axios";

const instance = axios.create({
  baseURL: "/api",
  timeout: 5000,
});
// 请求拦截器
instance.interceptors.request.use(
  (config) => {
    return config;
  },
  (err) => Promise.reject(err)
);

// 响应拦截器
instance.interceptors.response.use(
  (response) => {
    return response.data;
  },
  (err) => {
    Promise.reject(err);
  }
);

export default instance;
